package com.logistic.common.taglib;

import java.io.IOException;

import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

import com.logistic.common.Constants;

public class WayBillStatus extends TagSupport{ 
	/**
	 * 
	 */
	private static final long serialVersionUID = 6290388793965694092L;
	private String enStatus;
	private String isFastBox;

	public int doStartTag() { 
	  JspWriter out = pageContext.getOut();
	  String status = "";
	  if(enStatus.equalsIgnoreCase(Constants.WB_FORECAST_STATUS)){
		  status = "等待确认入库";
	  }
	  if(enStatus.equalsIgnoreCase(Constants.WB_ENTER_STATUS)){
		  status = "管理员已录入";
	  }
	  if(enStatus.equalsIgnoreCase(Constants.WB_UNHANDLE_STATUS)){
		  status = "未处理";
	  }
	  //这种情况是处理管理员审批的时候账号里钱不够的情况
	  if(enStatus.equalsIgnoreCase(Constants.WB_UNPAYFOR_STATUS1)){
		 // status = "待付款";
		  status = "余额不足";
	  }
	  if(enStatus.equalsIgnoreCase(Constants.WB_UNPAYFOR_STATUS)){
		  //status = "待付款";
		  status = "已付款,待发货";
	  }
	  if(enStatus.equalsIgnoreCase(Constants.WB_PAYFORUNSEND_STATUS)){
		  //status = "已付款,待发货";
		  status = "已发货，待转EMS";
	  }
	  if(enStatus.equalsIgnoreCase(Constants.WB_SENDED_STATUS)){
		  //status = "已发货";
		  status = "已转EMS";
		  
	  }
	  if(enStatus.equalsIgnoreCase(Constants.WB_ACCEPTED_STATUS)){
		  status = "交易完成";
	  }
	  try {
		out.println(status);
	} catch (IOException e) {
		e.printStackTrace();
	} 

		
	  return EVAL_PAGE;// 标签执行完后，继续执行后面的 
	}

	public int doEndTag() { 
		  return EVAL_PAGE; 
	} 

	public String getEnStatus() {
		return enStatus;
	}

	public void setEnStatus(String enStatus) {
		this.enStatus = enStatus;
	}
	
	public String getIsFastBox() {
		return isFastBox;
	}
	public void setIsFastBox(String isFastBox) {
		this.isFastBox = isFastBox;
	}
	
}
